package com.itkaien.demo01.router;

import com.itkaien.demo01.UserBizController.UserBizHanlder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.RouterFunctions;
import org.springframework.web.servlet.function.ServerResponse;

@Configuration
public class RouterConfig {

    @Bean
    public RouterFunction<ServerResponse> routerFunction(UserBizHanlder userBizHanlder){

        RouterFunction<ServerResponse> helloWorld = RouterFunctions.route()
                .GET("/hello", request -> ServerResponse.ok().body("hello world"))
                .GET("/hello2", userBizHanlder::login)
                .GET("/hello3", x-> ServerResponse.ok().body("hello world"))
                .build();
        return helloWorld;

    }




}
